package time.after.time.sys;

import java.io.File;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import org.apache.log4j.Logger;

/**
 * 系统启动类  [初始化系统资源]
 * @author HuMing create in 2012-2-14
 */
public class Boot extends HttpServlet{

	private static final long serialVersionUID = 1L;
	private static Logger logger = Logger.getLogger(Boot.class);

	public static String CLASS_PATH;
	
	
    public void init(ServletConfig conf) throws ServletException
    {
        super.init(conf);
    	logger.info("Server booting...");
        logger.info("OS Name:"+System.getProperty("os.name"));
        logger.info("OS Version:"+System.getProperty("os.version"));
        logger.info("OS Architecture:"+System.getProperty("os.arch"));
        logger.info("CPU Maybe:"+System.getProperty("sun.cpu.isalist"));
        logger.info("JRE Version:"+System.getProperty("java.version"));
        logger.info("JRE Runtime:"+System.getProperty("java.runtime.version"));

        java.net.URL url = getClass().getClassLoader().getResource("/");
        CLASS_PATH=new File(url.getPath()).getPath()+File.separator;
        logger.info("Class Path:"+CLASS_PATH);
        logger.info("BOOT OK!");
    }
    
    public void destroy()
    {
    	logger.info("Server shuting down...");
    }
}
